home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 8 code / Curves in Quickdraw / QD Curves / Access.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-09  |  1.9 KB  |  77 lines  |  [TEXT/KAHL]

  1. #ifndef sfntAccessIncludes
  2. #define sfntAccessIncludes
  3.  
  4. #include "sfnt_enum.h"
  5.  
  6. #define fNoError             0
  7. #define fTableNotFound        -1
  8. #define fNameNotFound        -2
  9. #define fMemoryError        -3
  10. #define fUnimplemented        -4
  11. #define fCMapNotFound        -5
  12. #define fGlyphNotFound        -6
  13.  
  14. typedef long FontError;
  15. typedef long fontTableTag;
  16.  
  17. typedef struct FontTableInfo {
  18.     long        offset;            /* from beginning of sfnt to beginning of the table */
  19.     long        length;            /* length of the table */
  20.     long        checkSum;        /* checkSum of the table */
  21. } FontTableInfo;
  22.  
  23. typedef struct FixPoint {
  24.     Fixed    x;
  25.     Fixed    y;
  26. } FixPoint;
  27.  
  28. typedef struct GlyphOutline {
  29.     long        contourCount;
  30.     long        pointCount;
  31.     
  32.     FixPoint    origin;
  33.     FixPoint    advance;
  34.  
  35.     short**    endPoints;        /* [contourCount] */
  36.     Byte**    onCurve;        /* [pointCount] */
  37.     Fixed**    x;            /* [pointCount] */
  38.     Fixed**    y;            /* [pointCount] */
  39. } GlyphOutline;
  40.  
  41. typedef Fixed Matrix[3][3];
  42.  
  43. /*    Return the number of tagged tables in the sfnt
  44. */
  45. long CountSfntTables(Handle sfnt);
  46.  
  47. /*    Return the tag for the indexth table, start with 0
  48.  *    Return 0 if index is out of range.
  49.  */
  50. fontTableTag GetSfntTag(Handle sfnt, long index);
  51.  
  52. /*    Fill out the FontTableInfo record for the tagged table.
  53. */
  54. FontError GetSfntTableInfo(Handle sfnt, fontTableTag, FontTableInfo*);
  55.  
  56. /*    Grow userCopy and then copy the tagged table into it.
  57. */
  58. FontError GetSfntTable(Handle sfnt, fontTableTag, Handle userCopy);
  59.  
  60. /*    Return in name the string for the font name identified by nameID.
  61.  *    Defined values for nameID are in sfnt_enum.h under sfnt_NameIndex.
  62.  */
  63. FontError GetSfntNameString(Handle sfnt, long nameID, Str255 name);
  64.  
  65. /*    Return the glyph index for the given charCode.  0 means the char is missing.
  66. */
  67. long GetCharGlyphIndex(Handle sfnt, unsigned short charCode);
  68.  
  69. /*    Return the number of glyphs in this sfnt.
  70. */
  71. long CountSfntGlyphs(Handle sfnt);
  72.  
  73. /*    Return the GlyphOutline record for the indexed glyph.
  74. */
  75. FontError GetGlyphOutline(Handle sfnt, long index, GlyphOutline*, Matrix);
  76.  
  77. #endif